library(maps)
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyr)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.0 ✔ readr 2.1.4
## ✔ lubridate 1.9.3 ✔ stringr 1.5.1
## ✔ purrr 1.0.2 ✔ tibble 3.2.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ✖ purrr::map() masks maps::map()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(sf)
## Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
library(rmapshaper)
library(mapview)
library(rnaturalearth)
library(mapproj)
library(ggrepel)
library(ggmap)
## ℹ Google's Terms of Service: <https://mapsplatform.google.com>
## ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
library(ggthemes)
OESdata<- read_csv("https://raw.githubusercontent.com/jzkvlds/creative-data-visualization/main/DATA/OESdata.csv", col_names = TRUE)
## New names:
## Rows: 90 Columns: 22
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (19): Country, Region, Site, Cal age BP " 1s/ka, 14C age BP, Calculated ... lgl
## (3): Calendar Date (95.4%) (BC), Specimen Number * check (institution),...
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...21`
head(OESdata)
## # A tibble: 6 × 22
## Country Region Site Calendar Date (95.4%…¹ `Cal age BP " 1s/ka` `14C age BP`
## <chr> <chr> <chr> <lgl> <chr> <chr>
## 1 China: … <NA> <NA> NA <NA> <NA>
## 2 China: … <NA> <NA> NA <NA> <NA>
## 3 China Yangw… <NA> NA <NA> <NA>
## 4 China Yangw… <NA> NA <NA> <NA>
## 5 China, … <NA> <NA> NA <NA> <NA>
## 6 China, … <NA> <NA> NA <NA> <NA>
## # ℹ abbreviated name: ¹`Calendar Date (95.4%) (BC)`
## # ℹ 16 more variables: `Calculated Age (1950 - # for BP) (BC)` <chr>,
## # Epoch <chr>, `Other available age data from publications cited` <chr>,
## # `What type of sample` <chr>, `Species Referal` <chr>,
## # `Species Referal Revised` <chr>,
## # `Specimen Number * check (institution)` <lgl>,
## # `Internal Lab ID ** check` <chr>, …
colnames(OESdata)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "details of location/environment"
## [16] "Cite"
## [17] "This paper cited..."
## [18] "Comments"
## [19] "LAT"
## [20] "LONG"
## [21] "...21"
## [22] "Dating Method"
CleanData <- OESdata[, -17]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "details of location/environment"
## [16] "Cite"
## [17] "Comments"
## [18] "LAT"
## [19] "LONG"
## [20] "...21"
## [21] "Dating Method"
#we checked that that worked so we want to remove another column
CleanData <- CleanData[,-17]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "details of location/environment"
## [16] "Cite"
## [17] "LAT"
## [18] "LONG"
## [19] "...21"
## [20] "Dating Method"
CleanData <- CleanData[,-19]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "details of location/environment"
## [16] "Cite"
## [17] "LAT"
## [18] "LONG"
## [19] "Dating Method"
CleanData <- CleanData[,-16]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "details of location/environment"
## [16] "LAT"
## [17] "LONG"
## [18] "Dating Method"
CleanData <- CleanData[,-15]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "LAT"
## [16] "LONG"
## [17] "Dating Method"
CleanData <- CleanData[,-17]
colnames(CleanData)
## [1] "Country"
## [2] "Region"
## [3] "Site"
## [4] "Calendar Date (95.4%) (BC)"
## [5] "Cal age BP \" 1s/ka"
## [6] "14C age BP"
## [7] "Calculated Age (1950 - # for BP) (BC)"
## [8] "Epoch"
## [9] "Other available age data from publications cited"
## [10] "What type of sample"
## [11] "Species Referal"
## [12] "Species Referal Revised"
## [13] "Specimen Number * check (institution)"
## [14] "Internal Lab ID ** check"
## [15] "LAT"
## [16] "LONG"
removeQuotes <- function(x) gsub("\"", "", x)
CleanData <- CleanData %>%
mutate_if(is.character, removeQuotes)
colnames(CleanData)[1] <- "Location"
head(CleanData)
## # A tibble: 6 × 16
## Location Region Site Calendar Date (95.4%…¹ `Cal age BP " 1s/ka` `14C age BP`
## <chr> <chr> <chr> <lgl> <chr> <chr>
## 1 China: … <NA> <NA> NA <NA> <NA>
## 2 China: … <NA> <NA> NA <NA> <NA>
## 3 China Yangw… <NA> NA <NA> <NA>
## 4 China Yangw… <NA> NA <NA> <NA>
## 5 China, … <NA> <NA> NA <NA> <NA>
## 6 China, … <NA> <NA> NA <NA> <NA>
## # ℹ abbreviated name: ¹`Calendar Date (95.4%) (BC)`
## # ℹ 10 more variables: `Calculated Age (1950 - # for BP) (BC)` <chr>,
## # Epoch <chr>, `Other available age data from publications cited` <chr>,
## # `What type of sample` <chr>, `Species Referal` <chr>,
## # `Species Referal Revised` <chr>,
## # `Specimen Number * check (institution)` <lgl>,
## # `Internal Lab ID ** check` <chr>, LAT <chr>, LONG <chr>
world <- map_data("world")
europe <- subset(world, region %in% c("Albania", "Andorra", "Armenia", "Austria", "Azerbaijan","Belarus", "Belgium", "Bosnia and Herzegovina", "Bulgaria", "Croatia", "Cyprus", "Czechia","Denmark","Estonia","Finland","France","Georgia", "Germany", "Greece","Hungary","Iceland","Ireland", "Italy","Kazakhstan", "Kosovo", "Latvia","Liechtenstein", "Lithuania", "Luxembourg","Malta","Moldova","Monaco","Montenegro", "Macedonia", "Netherlands","Norway","Poland","Portugal","Romania", "Russia","San Marino","Serbia","Slovakia","Slovenia","Spain", "Sweden","Switzerland","Turkey","Ukraine","UK","Vatican"))
ggplot(data = europe, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", color = "black") +
theme_void()
ggplot(data = europe, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", color = "black") +
theme_void() +
coord_fixed(ratio=1.5, xlim = c(-15,180), ylim = c(35,80))
asia <- subset(world, region %in% c("Afghanistan", "Armenia", "Azerbaijan", "Bahrain", "Bangladesh", "Bhutan",
"Brunei", "Cambodia", "China", "Cyprus", "Georgia", "India", "Indonesia", "Iran", "Iraq", "Israel", "Japan", "Jordan", "Kazakhstan", "Kuwait", "Kyrgyzstan", "Laos", "Lebanon", "Malaysia", "Maldives", "Mongolia", "Myanmar","Nepal", "North Korea", "Oman", "Pakistan", "Palestine", "Philippines", "Qatar", "Russia", "Saudi Arabia", "Singapore", "South Korea", "Sri Lanka", "Syria", "Taiwan", "Tajikistan", "Thailand", "Timor-Leste", "Turkey", "Turkmenistan", "United Arab Emirates", "Uzbekistan", "Vietnam", "Yemen"))
ggplot(data = asia, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", color = "black") +
coord_fixed(1.2)
ggplot(data = asia, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", color = "black") +
coord_fixed(1.2) +
theme_void()
eurasia <- rbind(europe, asia)
CleanData$LONG <-as.numeric(as.character(CleanData$LONG))
CleanData$LAT <-as.numeric(as.character(CleanData$LAT))
## Warning: NAs introduced by coercion
CData <- CleanData[!is.na(CleanData$LONG),]
CData <- CleanData[!is.na(CleanData$LAT),]
#Here I visualize with a black infill and change the size
ggplot() +
geom_map(
data = asia, map = world,
aes(x= long, y= lat, map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data = CData, aes(LONG, LAT))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning in geom_map(data = asia, map = world, aes(x = long, y = lat, map_id =
## region), : Ignoring unknown aesthetics: x and y
ggplot(data = eurasia, aes(x = long, y = lat)) +
geom_polygon(fill = "white", color = "black") +
coord_fixed(1.2) +
theme_void() +
geom_point(data=CData, aes(LONG,LAT), color="red")
EurasiaMap <- ggplot() +
geom_map(
data = eurasia, map = world,
aes(long, lat, map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(LONG,LAT), color="red", size = .5)
## Warning in geom_map(data = eurasia, map = world, aes(long, lat, map_id =
## region), : Ignoring unknown aesthetics: x and y
EurasiaMap
EurasiaMap <- ggplot() +
geom_map(
data = eurasia, map = world,
aes(long, lat, map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude")
## Warning in geom_map(data = eurasia, map = world, aes(long, lat, map_id =
## region), : Ignoring unknown aesthetics: x and y
EurasiaMap
china <- subset(world, region %in% c("China", "Mongolia"))
ggplot() +
geom_map(data = china, map= world,
aes(long, lat, map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(1.2)
## Warning in geom_map(data = china, map = world, aes(long, lat, map_id =
## region), : Ignoring unknown aesthetics: x and y
ggplot() +
geom_map(data = china, map= world,
aes(long, lat, map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(1.2) +
ggtitle("MAP of ancient OES: focusing on China and Mongolia")
## Warning in geom_map(data = china, map = world, aes(long, lat, map_id =
## region), : Ignoring unknown aesthetics: x and y
ggplot() +
geom_map(data = china, map= world,
aes(map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(1.2) +
ggtitle("MAP of ancient OES in China and Mongolia") +
geom_text(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text()`).
ggplot() +
geom_map(data = eurasia, map= world,
aes(map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(1.2) +
ggtitle("MAP of ancient OES: focusing on Eurasia") +
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 36 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
africa <- subset(world, region %in% c("Algeria", "Angola", "Benin", "Botswana", "Burkina Faso", "Burundi", "Cabo Verde", "Cameroon", "Central African Republic", "Chad", "Comoros", "Democratic Republic of the Congo", "Djibouti", "Egypt", "Equatorial Guinea", "Eritrea", "Eswatini", "Ethiopia", "Gabon", "Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivory Coast", "Kenya", "Lesotho", "Liberia", "Libya", "Madagascar", "Malawi", "Mali", "Mauritania", "Mauritius", "Morocco", "Mozambique", "Namibia", "Niger", "Nigeria", "Republic of the Congo", "Rwanda", "Sao Tome and Principe", "Senegal", "Seychelles", "Sierra Leone", "Somalia", "South Africa", "South Sudan", "Sudan", "Tanzania", "Togo", "Tunisia", "Uganda", "Zambia", "Zimbabwe"))
fullmap <- rbind(europe, asia, africa)
ggplot() +
geom_map(data = fullmap, map= world,
aes(map_id = region),
color = "black", fill = "lightgray", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 50 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
(I chose to use the color “palegreen4” for European countries, “deeppink4” for African countries, and “yellowgreen” for Asian countries.)
# create a colorful "world"
worldcolor <- mutate(world, fill = case_when(
region %in% c("Albania", "Andorra", "Armenia", "Austria", "Azerbaijan","Belarus", "Belgium", "Bosnia and Herzegovina", "Bulgaria", "Croatia", "Cyprus", "Czechia","Denmark","Estonia","Finland","France","Georgia", "Germany", "Greece","Hungary","Iceland","Ireland", "Italy","Kazakhstan", "Kosovo", "Latvia","Liechtenstein", "Lithuania", "Luxembourg","Malta","Moldova","Monaco","Montenegro", "Macedonia", "Netherlands","Norway","Poland","Portugal","Romania", "Russia","San Marino","Serbia","Slovakia","Slovenia","Spain", "Sweden","Switzerland","Turkey","Ukraine","UK","Vatican") ~ "palegreen4",
region %in% c("Algeria", "Angola", "Benin", "Botswana", "Burkina Faso", "Burundi", "Cabo Verde", "Cameroon", "Central African Republic", "Chad", "Comoros", "Democratic Republic of the Congo", "Djibouti", "Egypt", "Equatorial Guinea", "Eritrea", "Eswatini", "Ethiopia", "Gabon", "Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivory Coast", "Kenya", "Lesotho", "Liberia", "Libya", "Madagascar", "Malawi", "Mali", "Mauritania", "Mauritius", "Morocco", "Mozambique", "Namibia", "Niger", "Nigeria", "Republic of the Congo", "Rwanda", "Sao Tome and Principe", "Senegal", "Seychelles", "Sierra Leone", "Somalia", "South Africa", "South Sudan", "Sudan", "Tanzania", "Togo", "Tunisia", "Uganda", "Zambia", "Zimbabwe") ~ "deeppink4",
region %in% c( "Afghanistan", "Armenia", "Azerbaijan", "Bahrain", "Bangladesh", "Bhutan",
"Brunei", "Cambodia", "China", "Cyprus", "Georgia", "India", "Indonesia", "Iran", "Iraq", "Israel", "Japan", "Jordan", "Kazakhstan", "Kuwait", "Kyrgyzstan", "Laos", "Lebanon", "Malaysia", "Maldives", "Mongolia", "Myanmar","Nepal", "North Korea", "Oman", "Pakistan", "Palestine", "Philippines", "Qatar", "Russia", "Saudi Arabia", "Singapore", "South Korea", "Sri Lanka", "Syria", "Taiwan", "Tajikistan", "Thailand", "Timor-Leste", "Turkey", "Turkmenistan", "United Arab Emirates", "Uzbekistan", "Vietnam", "Yemen") ~ "yellowgreen",
TRUE ~ "white"))
#create a colorful Africa named "africacolor"
africacolor <- subset(worldcolor, region %in% c("Algeria", "Angola", "Benin", "Botswana", "Burkina Faso", "Burundi", "Cabo Verde", "Cameroon", "Central African Republic", "Chad", "Comoros", "Democratic Republic of the Congo", "Djibouti", "Egypt", "Equatorial Guinea", "Eritrea", "Eswatini", "Ethiopia", "Gabon", "Gambia", "Ghana", "Guinea", "Guinea-Bissau", "Ivory Coast", "Kenya", "Lesotho", "Liberia", "Libya", "Madagascar", "Malawi", "Mali", "Mauritania", "Mauritius", "Morocco", "Mozambique", "Namibia", "Niger", "Nigeria", "Republic of the Congo", "Rwanda", "Sao Tome and Principe", "Senegal", "Seychelles", "Sierra Leone", "Somalia", "South Africa", "South Sudan", "Sudan", "Tanzania", "Togo", "Tunisia", "Uganda", "Zambia", "Zimbabwe"))
#create a colorful Asia named "asiacolor"
asiacolor <- subset(worldcolor, region %in% c("Afghanistan", "Armenia", "Azerbaijan", "Bahrain", "Bangladesh", "Bhutan",
"Brunei", "Cambodia", "China", "Cyprus", "Georgia", "India", "Indonesia", "Iran", "Iraq", "Israel", "Japan", "Jordan", "Kazakhstan", "Kuwait", "Kyrgyzstan", "Laos", "Lebanon", "Malaysia", "Maldives", "Mongolia", "Myanmar","Nepal", "North Korea", "Oman", "Pakistan", "Palestine", "Philippines", "Qatar", "Russia", "Saudi Arabia", "Singapore", "South Korea", "Sri Lanka", "Syria", "Taiwan", "Tajikistan", "Thailand", "Timor-Leste", "Turkey", "Turkmenistan", "United Arab Emirates", "Uzbekistan", "Vietnam", "Yemen"))
#create a colorful Europe named "europecolor"
europecolor <- subset(worldcolor, region %in% c("Albania", "Andorra", "Armenia", "Austria", "Azerbaijan","Belarus", "Belgium", "Bosnia and Herzegovina", "Bulgaria", "Croatia", "Cyprus", "Czechia","Denmark","Estonia","Finland","France","Georgia", "Germany", "Greece","Hungary","Iceland","Ireland", "Italy","Kazakhstan", "Kosovo", "Latvia","Liechtenstein", "Lithuania", "Luxembourg","Malta","Moldova","Monaco","Montenegro", "Macedonia", "Netherlands","Norway","Poland","Portugal","Romania", "Russia","San Marino","Serbia","Slovakia","Slovenia","Spain", "Sweden","Switzerland","Turkey","Ukraine","UK","Vatican"))
#Now we rbind the colorful maps into a "fullmapcolor"
fullmapcolor <- rbind(europecolor, asiacolor, africacolor)
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5, shape = 24) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5, shape = 24) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void()
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 48 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT), color="red", size = .5, shape = 24) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void() +
theme(plot.title = element_text(hjust = 0.5))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 48 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
CData$Location <- gsub("\\?", "", CData$Location)
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Location), size = .5, shape = 4) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void() +
theme(plot.title = element_text(hjust = 0.5))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 67 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Location), size = .5, shape = 4) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void() +
theme(plot.title = element_text(hjust = 0.5))+
theme(legend.key.size = unit(0.4, "lines"))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 67 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Location), size = .5) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void() +
theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 50 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
but what if we want to color the points by Epoch? AND also change the shape!
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Epoch), size = .5, shape = 13) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES (by Epoch)") +
scale_fill_identity()+
geom_text_repel(
data= CData,
aes( x = LONG, y = LAT, label= `Species Referal`)) +
theme_void() +
theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))
## Warning: Removed 16 rows containing missing values or values outside the scale range
## (`geom_text_repel()`).
## Warning: ggrepel: 48 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps
# Here I remove the species referral labels:
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Epoch), size = .5, shape = 13) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 80), ratio = 3/2)+
ggtitle("MAP of ancient OES (by Epoch)") +
scale_fill_identity()+
theme_void() +
theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))
#Here I zoom into the map so focus more on where OES are found
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = Epoch), size = .5, shape = 13) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 50), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity()+
theme_void() +
theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = `Species Referal`), size = 1, shape = 8) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-90, 200), ylim = c(-30, 50), ratio = 3/2)+
ggtitle("MAP of ancient OES") +
scale_fill_identity() +
theme_void() +
theme(plot.title = element_text(hjust = 0.5))+theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))
ggplot() +
geom_map(data = fullmapcolor, map= worldcolor,
aes(map_id = region, fill = fill),
color = "black", size = 0.1) +
geom_point(data=CData, aes(x = LONG, y = LAT, color = `Species Referal`), size = 1, shape = 8) +
labs ( x = "Longitude", y = "Latitude") +
coord_fixed(xlim = c(-80, 180), ylim = c(-30, 50), ratio = 3/2)+
ggtitle("MAP of ancient OES (by species)") +
scale_fill_identity() +
theme(plot.title = element_text(hjust = 0.5))+theme(legend.position = "bottom", legend.key.size = unit(0.1, "lines")) +
theme(plot.title = element_text(hjust = 0.5))